{	Problem: http://codeforces.ru/problemset/problem/15/A
	Verdict: Accepted
}
var n,i,t,r:longint; a:Array[1..1010,1..2] of longint; k:double;
procedure qsort(l,r:longint);
var i,j,x,y:longint;
begin
i:=l;
j:=r;
x:=a[(l+r) div 2][1];
repeat
  while a[i][1]<x do inc(i);
  while a[j][1]>x do dec(j);
  if i<=j then begin
    y:=a[i][1];
    a[i][1]:=a[j][1];
    a[j][1]:=y;
    y:=a[i][2];
    a[i][2]:=a[j][2];
    a[j][2]:=y;
    inc(i);
    dec(j);
  end;
until i>j;
if l<j then qsort(l,j);
if i<r then qsort(i,r);
end;
begin
read(n,t);
for i:=1 to n do read(a[i][1],a[i][2]);
r:=2;
qsort(1,n);
dec(n);
for i:=1 to n do begin
  k:=abs(a[i+1][1]-a[i][1])-a[i+1][2]/2-a[i][2]/2;
  if k>t then inc(r,2) else
  if k=t then inc(r);
end;
write(r);
end.